var a,
  n = require("../../@babel/runtime/helpers/defineProperty"),
  t = require("../../res/www.a9a.cn.js"),
  o = getApp();
Page({
  data: {
    miao: 120,
    miao2: 120,
    nTitle: "账户/认证",
    mask_class: "alpha0_100",
  },
  onLoad: function (a) {
    var n = this,
      e = this;
    o.get_config("_ZEAI").then(function (a) {
      e.setData({ color: o._ZEAI.color, rgbcolor: t.c16_rgb(o._ZEAI.color) });
    }),
      o.get_openid().then(function (a) {
        n.init();
      });
  },
  init: function () {
    var n = this;
    (a = wx.getStorageSync("COOK_U")),
      o.ajax({
        url: "tg.php",
        data: { submitok: "myinfo_BANK", openid: a.openid },
        success: function (a) {
          1 == a.flag
            ? n.setData({ D: a.D })
            : wx.showToast({ title: a.msg, icon: "none", mask: !0 });
        },
      });
  },
  myinfoBANKfn: function () {
    this.setData({ div_myinfoBANK_form: !0 });
  },
  myinfoMOBRZfn: function () {
    this.setData({ div_myinfoMOBRZ_form: !0 });
  },
  myinfoBANKsubmitFn: function (e) {
    var i = this,
      s = e.detail.value;
    o.ajax({
      url: "tg.php",
      data: {
        submitok: "myinfo_BANK_modupdate",
        openid: a.openid,
        alipay_truename: s.alipay_truename,
        alipay_username: s.alipay_username,
        bank_card: s.bank_card,
        bank_name: s.bank_name,
        bank_name_kaihu: s.bank_name_kaihu,
        bank_truename: s.bank_truename,
      },
      success: function (a) {
        var o;
        1 == a.flag
          ? (wx.showToast({ title: a.msg, icon: "none", mask: !0 }),
            i.setData(
              (n((o = {}), "D.alipay_truename", s.alipay_truename),
              n(o, "D.alipay_username", s.alipay_username),
              n(o, "D.bank_card", s.bank_card),
              n(o, "D.bank_name", s.bank_name),
              n(o, "D.bank_name_kaihu", s.bank_name_kaihu),
              n(o, "D.bank_truename", s.bank_truename),
              n(o, "div_myinfoBANK_form", !1),
              o)
            ))
          : ((a.this = i), (a.url = "no"), t.sorry(a));
      },
    });
  },
  value_mobFn: function (a) {
    this.setData({ value_mob: a.detail.value });
  },
  getyzmFn: function (n) {
    var e = this.data.value_mob;
    if (t.ifmob(e)) {
      var i = this;
      (a = wx.getStorageSync("COOK_U")),
        o.ajax({
          url: "tg.php",
          data: {
            submitok: "ajax_get_verify",
            mob: e,
            kind: "tg_mob_rz",
            openid: a.openid,
          },
          success: function (a) {
            1 == a.flag
              ? (wx.showToast({ title: a.msg, icon: "none", mask: !0 }),
                i.setData({
                  ss: a.ss,
                  value_verify: "",
                  miao: i.data.miao2 - 1,
                }),
                (i.time = setInterval(function () {
                  i.setData({ miao: i.data.miao - 1 }),
                    0 == i.data.miao && clearInterval(i.time);
                }, 1e3)))
              : wx.showModal({
                  content: a.msg,
                  confirmColor: i.data.color,
                  confirmText: "朕知道了",
                  showCancel: !1,
                  success: function (a) {},
                });
          },
        });
    } else
      wx.showToast({ title: "请输入正确的【手机号】", icon: "none", mask: !0 });
  },
  submit_mob_Fn: function (e) {
    var i = this,
      s = e.detail.value.mob,
      m = e.detail.value.verify;
    t.ifmob(s)
      ? t.ifint(m)
        ? ((a = wx.getStorageSync("COOK_U")),
          o.ajax({
            url: "tg.php",
            data: {
              submitok: "myinfo_MOBRZ_update",
              mob: s,
              ss: i.data.ss,
              verify: m,
              openid: a.openid,
            },
            success: function (a) {
              1 == a.flag
                ? (wx.showToast({ title: a.msg, mask: !0, duration: 3e3 }),
                  setTimeout(function () {
                    var a;
                    i.setData(
                      (n(
                        (a = { div_myinfoMOBRZ_form: !1 }),
                        "D.mob_rz_class",
                        "LV"
                      ),
                      n(a, "miao", 0),
                      a)
                    );
                  }, 3e3))
                : wx.showModal({
                    content: a.msg,
                    confirmColor: i.data.color,
                    confirmText: "朕知道了",
                    showCancel: !1,
                    success: function (a) {},
                  });
            },
          }))
        : wx.showToast({
            title: "请输入正确的【验证码】",
            icon: "none",
            mask: !0,
          })
      : wx.showToast({
          title: "请输入正确的【手机号】",
          icon: "none",
          mask: !0,
        });
  },
  my_info_closeFn: function () {
    this.setData({ div_myinfoBANK_form: !1, div_myinfoMOBRZ_form: !1 });
  },
});
